// 题库相关接口
import { request } from "../base/index.mjs";
/**
 * 请求回调
 * @callback requestCallback
 * @param {object} data 请求回调的数据
 */
export default {
    /**
	 * 基础数据项目转换题库项目 QB310904
	 * @param {object} opt
	 * @param {object} [opt.data] 请求入参
	 * @param {string} opt.data.projectIds 基础数据项目标识
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
     translateProjectIdsBDToQB(opt = {}) {
		Http.callService({
			url: "qb/tpo/class/list/projectids",
			data: opt.data
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
    /**
	 * 基础数据科目转换题库科目转换
	 * @param {object} opt
	 * @param {object} [opt.data] 请求入参
	 * @param {string} opt.data.bdsubjectIds 科目标识集合
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
     translateSubjectIdsBDToQB(opt = {}) {
		Http.callService({
			url: "qb/business/subject/convert",
			data: opt.data
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
    /**
	 * 试题列表 QB310401
	 * @param {object} opt
	 * @param {object} [opt.data] 请求入参
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
     queryQuestionList(opt = {}) {
		Http.callService({
			url: "qb/tpo/question/list",
			data: opt.data
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
    /**
	 * 试题分类列表 QB310401
	 * @param {object} opt
	 * @param {object} [opt.data] 请求入参
     * @param {string} opt.data.questioncategoryType 试题分类状态
     * @param {string} opt.data.projectId 基础数据项目标识
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
     queryQuestionCategoryList(opt = {}) {
		Http.callService({
			url: "qb/tpo/question/category/profile/list",
			data: opt.data
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
    /**
	 * 根据试题id查询试题列表 QB310905
	 * @param {object} opt
	 * @param {object} [opt.data] 请求入参
     * @param {string} opt.data.questionIds 试题标识,号隔开
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
     queryQuestionListByIds(opt = {}) {
		Http.callService({
			url: "qb/tpo/knowledge/question/list",
			data: opt.data
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
    /**
	 * 题库章节树 QB310211
	 * @param {object} opt
	 * @param {object} [opt.data] 请求入参
     * @param {string} opt.data.subjectId 科目标识
     * @param {string} opt.data.classId 项目标识
     * @param {string} opt.data.sectionShowstatus 章节展示状态 [枚举]S:展示Show;H:隐藏Hide
     * @param {string} opt.data.sectionAvlstatus 章节可用状态	[枚举]Y:可用Yes;N:不可用No
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
     queryTpoSectionTree(opt = {}) {
		Http.callService({
			url: "qb/tpo/section/tree",
			data: opt.data
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	queryQuestionListByContent(params = {}) {
		return request("qb/repository/question/content-list", params);
	},
};
